// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class CSU : AbstractDataType
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Channel Sensitivity",1)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"NM")]
	    public NM ChannelSensitivity {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Unit of Measure Identifier",2)]
  	    [HL7Field(HL7Version.v231, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST UnitofMeasureIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Unit of Measure Description",3)]
  	    [HL7Field(HL7Version.v231, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST UnitofMeasureDescription {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Unit of Measure Coding System",4)]
  	    [HL7Field(HL7Version.v231, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID UnitofMeasureCodingSystem {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Alternate Unit of Measure Identifier",5)]
  	    [HL7Field(HL7Version.v231, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Alternate Unit of Measure Description",6)]
  	    [HL7Field(HL7Version.v231, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureDescription {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Alternate Unit of Measure Coding System",7)]
  	    [HL7Field(HL7Version.v231, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID AlternateUnitofMeasureCodingSystem {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Unit of Measure Coding System Version ID",8)]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST UnitofMeasureCodingSystemVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Alternate Unit of Measure Coding System Version ID",9)]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureCodingSystemVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Original Text",10)]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST OriginalText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Second Alternate Unit of Measure Identifier",11)]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateUnitofMeasureIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("12 Second Alternate Unit of Measure Text",12)]
  	    [HL7Field(HL7Version.v27, 12, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateUnitofMeasureText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("13 Name of Second Alternate Unit of Measure Coding Sy",13)]
  	    [HL7Field(HL7Version.v27, 13, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID NameofSecondAlternateUnitofMeasureCodingSy {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("14 Second Alternate Unit of Measure Coding System Ver",14)]
  	    [HL7Field(HL7Version.v27, 14, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateUnitofMeasureCodingSystemVer {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("15 Unit of Measure Coding System OID",15)]
  	    [HL7Field(HL7Version.v27, 15, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST UnitofMeasureCodingSystemOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("16 Unit of Measure Value Set OID",16)]
  	    [HL7Field(HL7Version.v27, 16, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST UnitofMeasureValueSetOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("17 Unit of Measure Value Set Version ID",17)]
  	    [HL7Field(HL7Version.v27, 17, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM UnitofMeasureValueSetVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("18 Alternate Unit of Measure Coding System OID",18)]
  	    [HL7Field(HL7Version.v27, 18, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 21, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureCodingSystemOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("19 Alternate Unit of Measure Value Set OID",19)]
  	    [HL7Field(HL7Version.v27, 19, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 22, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureValueSetOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("20 Alternate Unit of Measure Value Set Version ID",20)]
  	    [HL7Field(HL7Version.v27, 20, HL7Repeat.False, HL7Required.True,"DTM")]
  	    [HL7Field(HL7Version.v27, 23, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateUnitofMeasureValueSetVersionID {get;set;}





		public override string GetER7(HL7ParserOptions options) {
			List<string> dataTypeParts = new List<string>();
			dataTypeParts.Add(GetER7TextForDataPart(ChannelSensitivity, options));
		    dataTypeParts.Add(UnitofMeasureIdentifier);
		    dataTypeParts.Add(UnitofMeasureDescription);
		    dataTypeParts.Add(UnitofMeasureCodingSystem);
		    dataTypeParts.Add(AlternateUnitofMeasureIdentifier);
		    dataTypeParts.Add(AlternateUnitofMeasureDescription);
		    dataTypeParts.Add(AlternateUnitofMeasureCodingSystem);
		    dataTypeParts.Add(UnitofMeasureCodingSystemVersionID);
		    dataTypeParts.Add(AlternateUnitofMeasureCodingSystemVersionID);
		    dataTypeParts.Add(OriginalText);
		    dataTypeParts.Add(SecondAlternateUnitofMeasureIdentifier);
		    dataTypeParts.Add(SecondAlternateUnitofMeasureText);
		    dataTypeParts.Add(NameofSecondAlternateUnitofMeasureCodingSy);
		    dataTypeParts.Add(SecondAlternateUnitofMeasureCodingSystemVer);
		    dataTypeParts.Add(UnitofMeasureCodingSystemOID);
		    dataTypeParts.Add(UnitofMeasureValueSetOID);
			dataTypeParts.Add(GetER7TextForDataPart(UnitofMeasureValueSetVersionID, options));
		    dataTypeParts.Add(AlternateUnitofMeasureCodingSystemOID);
		    dataTypeParts.Add(AlternateUnitofMeasureValueSetOID);
		    dataTypeParts.Add(AlternateUnitofMeasureValueSetVersionID);
			return CleanUpTrailingComponentSeps(string.Join("" + options.ComponentSep, dataTypeParts.ToArray()), options);
		}
    }
}

